package com.sunny.activiti.service;

import org.activiti.engine.repository.Model;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @ClassName: IProcesService
 * @Description: 流程服务接口
 * @Author: sunt
 * @Date: 2020/5/28 14:15
 * @Version 1.0
 **/
public interface IProcesService {

    /**
     * 启动流程
     * @param processDefinitionKey 流程定义KEY
     * @param businessKey 业务编码
     * @return
     */
    ProcessInstance startProcessInstanceByKey(String processDefinitionKey, String businessKey);

    /**
     * 上传流程流程定义
     * @param multipartFile
     * @return
     */
    String upload(MultipartFile multipartFile) throws IOException;

    /**
     * 上传并部署流程定义
     * @param file
     * @return
     * @throws IOException
     */
    Model uploadStreamAndDeployment(MultipartFile file) throws IOException;

    /**
     * 导出文件
     * @param modelId
     * @param response
     */
    void exportModel(String modelId, HttpServletResponse response);
}
